﻿using System.Web.Mvc;
using Business;

namespace YaoYunDong.Controllers
{
    public class AjaxController : Controller
    {
        private readonly UserBusiness userBusiness = new UserBusiness();

        public string CheckEmail(string email)
        {
            bool b = userBusiness.CheckMailExists(email);
            return b ? "1" : "2";
        }

        public string CheckNickName(string nickName)
        {
            bool b = userBusiness.CheckNicknameExists(nickName);
            return b ? "1" : "2";
        }

        public string CheckValidate(string validate)
        {
            return validate == Session["ValidateNumber"].ToString() ? "2" : "1";
        }
    }
}